package com.leileimann.tour.service;

import com.leileimann.tour.entity.User;
import com.leileimann.tour.mapper.UserMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author leileiMann
 * @date 2022/3/4 13:51
 */
@Service
public class UserService {
    @Autowired
    private UserMapper userMapper;
//
//    /**
//     * 通过手机号和密码进行登录 查找到该号码就判断是否有密码，不然就为空代表没有该用户号码 调用dao层方法
//     * */
//    public User findByTelAndPassword(String tel,String password){
//        User user = userMapper.findByTel(tel);
//        if (user!=null && password == user.getPassword()){
//            return user;
//        }else{
//            return null;
//        }
//    }

//    /**
//     * 通过用户名和密码登录
//     * */
//    public User findByNameAndPassword(@Param("username")String username,@Param("password")String password){
//        User user = userMapper.findByUsernameAndPassword(username,password);
//        System.out.println("UserMapper中的user："+user);
//        if (user != null && password == user.getPassword()){
//            return user;
//        }else{
//            return null;
//        }
//    }
}
